<?xml version="1.0" encoding="utf-8"?>

<EFFECT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns ="urn:dsfx0">    
  
  <DST_STATE_GROUP>
    <NAME>DepthNoTestNoWrite</NAME>
    <DEPTH_ENABLE>false</DEPTH_ENABLE>
    <DEPTH_WRITE>false</DEPTH_WRITE>
  </DST_STATE_GROUP>

  <BLEND_STATE_GROUP>
    <NAME>AlphaBlending</NAME>
    <SEPARATE_BLEND>false</SEPARATE_BLEND>
    <TARGET>
      <ID>0</ID>
      <BLEND_ENABLE>false</BLEND_ENABLE>
      <COLOR_SRC_BLEND>SrcAlpha</COLOR_SRC_BLEND>
      <COLOR_DST_BLEND>OneMinusSrcAlpha</COLOR_DST_BLEND>
      <COLOR_BLEND_OP>Add</COLOR_BLEND_OP>
      <ALPHA_SRC_BLEND>Zero</ALPHA_SRC_BLEND>
      <ALPHA_DST_BLEND>One</ALPHA_DST_BLEND>
      <ALPHA_BLEND_OP>Add</ALPHA_BLEND_OP>
    </TARGET>
  </BLEND_STATE_GROUP>

  <RAST_STATE_GROUP>
    <NAME>Solid</NAME>
    <CULL_MODE>None</CULL_MODE>
    <FILL_MODE>Solid</FILL_MODE>
    <DEPTH_BIAS>0</DEPTH_BIAS>
    <DEPTH_SLOPE_FACTOR>0</DEPTH_SLOPE_FACTOR>
  </RAST_STATE_GROUP>

  <SAMPLER>
    <NAME>s_SourceTex</NAME>
    <SAMPLER_TYPE>usampler2DArray</SAMPLER_TYPE>
    <SAMPLER_SECONDARY_TYPE>color</SAMPLER_SECONDARY_TYPE>
  </SAMPLER>

  <SAMPLER>
    <NAME>s_DepthsTex</NAME>
    <SAMPLER_TYPE>usampler2DArray</SAMPLER_TYPE>
    <SAMPLER_SECONDARY_TYPE>color</SAMPLER_SECONDARY_TYPE>
  </SAMPLER>

  <SAMPLER>
    <NAME>s_BackBuffer</NAME>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2DArray</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>!IS_MSAA VIEW_ARRAY_ID</SAMPLER_OPTION_GRAMMAR>
      <SAMPLER_OPTION_GRAMMAR>!IS_MSAA MultiviewSinglePass&gt;1</SAMPLER_OPTION_GRAMMAR> <!-- MultiviewSinglePass > 1 -->
    </SAMPLER_DECLARATION>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2DMSArray</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>IS_MSAA VIEW_ARRAY_ID</SAMPLER_OPTION_GRAMMAR>
      <SAMPLER_OPTION_GRAMMAR>IS_MSAA MultiviewSinglePass&gt;1</SAMPLER_OPTION_GRAMMAR> <!-- MultiviewSinglePass > 1 -->
    </SAMPLER_DECLARATION>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2D</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>!IS_MSAA !VIEW_ARRAY_ID !MultiviewSinglePass</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2DMS</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>IS_MSAA !VIEW_ARRAY_ID !MultiviewSinglePass</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
    <SAMPLER_SECONDARY_TYPE>color</SAMPLER_SECONDARY_TYPE>
  </SAMPLER>
  
  <SAMPLER>
    <NAME>s_Tail</NAME>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2DArray</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>VIEW_ARRAY_ID</SAMPLER_OPTION_GRAMMAR>
      <SAMPLER_OPTION_GRAMMAR>MultiviewSinglePass&gt;1</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2D</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>!VIEW_ARRAY_ID !MultiviewSinglePass</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
  </SAMPLER>
  
  <SAMPLER>
    <NAME>s_TailDepth</NAME>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2DArray</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>VIEW_ARRAY_ID</SAMPLER_OPTION_GRAMMAR>
      <SAMPLER_OPTION_GRAMMAR>MultiviewSinglePass&gt;1</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
    <SAMPLER_DECLARATION>
      <SAMPLER_TYPE>sampler2D</SAMPLER_TYPE>
      <SAMPLER_OPTION_GRAMMAR>!VIEW_ARRAY_ID !MultiviewSinglePass</SAMPLER_OPTION_GRAMMAR>
    </SAMPLER_DECLARATION>
  </SAMPLER>
  
  <SAMPLER_STATE>
    <NAME>smpLinear</NAME>
    <MAG_FILTER>Linear</MAG_FILTER>
    <MIN_FILTER>Linear</MIN_FILTER>
    <MIP_FILTER>None</MIP_FILTER>
  </SAMPLER_STATE>

  <SAMPLER_STATE>
    <NAME>smpNearest</NAME>
    <MAG_FILTER>Nearest</MAG_FILTER>
    <MIN_FILTER>Nearest</MIN_FILTER>
    <MIP_FILTER>None</MIP_FILTER>
  </SAMPLER_STATE>
  
  <TECHNIQUE>
    <NAME>PostProcess</NAME>
    <PASS>
      <SAMPLER_ASSIGNMENT_LIST>
        <SAMPLER_ASSIGNMENT>
          <SAMPLER>s_SourceTex</SAMPLER>
          <STATES>smpNearest</STATES>
        </SAMPLER_ASSIGNMENT>
        <SAMPLER_ASSIGNMENT>
          <SAMPLER>s_DepthsTex</SAMPLER>
          <STATES>smpNearest</STATES>
        </SAMPLER_ASSIGNMENT>
        <SAMPLER_ASSIGNMENT>
          <SAMPLER>s_BackBuffer</SAMPLER>
          <STATES>smpLinear</STATES>
        </SAMPLER_ASSIGNMENT>
        <SAMPLER_ASSIGNMENT>
          <SAMPLER>s_Tail</SAMPLER>
          <STATES>smpLinear</STATES>
        </SAMPLER_ASSIGNMENT>
        <SAMPLER_ASSIGNMENT>
          <SAMPLER>s_TailDepth</SAMPLER>
          <STATES>smpLinear</STATES>
        </SAMPLER_ASSIGNMENT>
      </SAMPLER_ASSIGNMENT_LIST>

      <STREAMS>
        <STREAM>
          <STAGES>Vertex_Fragment</STAGES>
          <VARYING>
            <NAME>vTexCoord</NAME>
            <TYPE>float2</TYPE>
            <QUALIFIER>smooth</QUALIFIER>
          </VARYING>
        </STREAM>
      </STREAMS>

      <SHADER_OPTIONS>
        <SHADER_OPTION>
          <NAME>NeedUVs</NAME>
          <OPTION_VALUE>1</OPTION_VALUE>
        </SHADER_OPTION>
        <SHADER_OPTION>
          <NAME>TexCoordAsVec2</NAME>
          <OPTION_VALUE>1</OPTION_VALUE>
        </SHADER_OPTION>
        <SHADER_OPTION>
          <NAME>OIT</NAME>
          <OPTION_VALUE>1</OPTION_VALUE>
        </SHADER_OPTION>
      </SHADER_OPTIONS>
      
      <NAME>Pass0</NAME>
      <BLEND_STATE>AlphaBlending</BLEND_STATE>
      <DEPTH_STENCIL_STATE>DepthNoTestNoWrite</DEPTH_STENCIL_STATE>
      <RASTERIZER_STATE>Solid</RASTERIZER_STATE>
      <COMMONS>streams varyings ubos</COMMONS>
      <VERTEX_STAGE>PostEffect_FullScreenQuadVS</VERTEX_STAGE>
      <FRAGMENT_STAGE>OITCommons PostEffect_DeclarePS PostEffect_ResolveOIT</FRAGMENT_STAGE>
    </PASS>
  </TECHNIQUE>
    
</EFFECT>
